<?php
/** $Id: default_form.php 11917 2009-05-29 19:37:05Z ian $ */
defined( '_JEXEC' ) or die( 'Restricted access' );
$session=JFactory::getSession();

$chars = "abcdefghijkmnopqrstuvwxyz"; 
    srand((double)microtime()*1000000); 
    $i = 0; 
    $pass = '' ; 

    while ($i <= 6) { 
        $num = rand() % 33; 
        $tmp = substr($chars, $num, 1); 
        $pass = $pass . $tmp; 
        $i++; 
    } 
$session->set('captcha',$pass);
?>

	<tr><td colspan="2"> <div class="title-top" ><h4><?php echo JText::_('CONTACT_FORM'); ?><h4/></div> </td></tr>
	<tr>
		<td colspan="2" style="padding-top:5px; padding-bottom:5px; color:red;">&nbsp;
		<?php 
		if(isset($this->error)){ 
			echo $this->error; 
		} ?>
		</td>
	</tr>

			
	<form action="<?php echo JRoute::_( 'index.php' );?>" method="post" name="emailForm" id="emailForm" class="form-validate">
		<div class="contact_email<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
			<tr><th style="padding-bottom:5px; width:140px;">	
				<label for="contact_name">
					&nbsp;<?php echo JText::_( 'Enter your name' );?>:
				</label>
			</th>
			<td style="padding-bottom:5px;">
				<input type="text" name="name" id="contact_name" size="50" class="inputbox" value="" />
			</td></tr>	
			<tr><th style="padding-bottom:5px;">	
			<label id="contact_emailmsg" for="contact_email">
				&nbsp;<?php echo JText::_( 'Email address' );?>:
			</label>
			</th>
			<td style="padding-bottom:5px;">
			<input type="text" id="contact_email" name="email" size="50" value="" class="inputbox required validate-email" maxlength="100" />
			</td></tr>
			<tr><th style="padding-bottom:5px;">
			<label for="contact_subject">
				&nbsp;<?php echo JText::_( 'Message subject' );?>:
			</label>
			</th>
			<td style="padding-bottom:5px;">
			<input type="text" name="subject" id="contact_subject" size="50" class="inputbox" value="" />
			</td></tr>
            <tr>
                <th style="padding-bottom:5px;" valign="top">
                                    <label id="contact_textmsg" for="contact_text" style="padding: 2px 0 0 0;">
    				&nbsp;<?php echo JText::_( 'Enter your message' );?>:
    			</label>
    			</th>
    			<td style="padding-bottom:5px;">
    			<textarea style="width:280px; height: 180px;" name="text" id="contact_text" class="inputbox required"></textarea>
    			</td>
            </tr>
            <tr>
        		<th style="padding-bottom:5px;" valign="top">
        			<label id="contact_textmsg" for="contact_text" >
        				<?php echo JText::_( 'SECURITYCODE' ); ?>*:</label>
        		</th>
        		<td colspan="2">
        		<input type="text" name="captcha" id="captcha-form" autocomplete="off" /><br/><br/>
        		<img src="<?php echo JURI::root() ?>components/com_contact/captchar/captcha.php?captcha=<?php echo $pass; ?>" id="captcha" /><br/>
        
        		</td>
        	</tr>

			<tr>
                <td></td>
                <td align="left" style="padding-bottom:5px;">
    			<button class="" type="submit"><?php echo JText::_('Send'); ?></button>
    			<button class="" type="reset"><?php echo JText::_('Reset'); ?></button>
    			</td>
            </tr>
            
		</div>

	<input type="hidden" name="option" value="com_contact" />
	<input type="hidden" name="view" value="contact" />
	<input type="hidden" name="id" value="<?php echo $this->contact->id; ?>" />
	<input type="hidden" name="task" value="submit" />
	<?php echo JHTML::_( 'form.token' ); ?>
	</form>
	
	